{extend name='admin@main'}
{block name="content"}
<div class="think-box-shadow">
    {include file='goods/index_search'}
    <div class="layui_table_width_scroll">
        <table class="layui-table margin-top-10"  lay-skin="line" >
            {notempty name='list'}
            <thead>
            <tr>
                <th class="text-left nowrap">日期</th>
                <th class='text-left'>渠道</th>
                <th class='text-left ' >新增用户</th>
                <th class='text-left ' >新增用户破产率</th>
                <th class='text-left'>活跃用户</th>
                <th class='text-left '>活跃用户破产率</th>
                <th class='text-left'>付费金额</th>
                <th class='text-left'>付费用户</th>
                <th class='text-left'>付费次数</th>
                <th class='text-left'>人均付费次数</th>
                <th class='text-left'>付费率</th>
                <th class='text-left'>ARPU</th>
                <th class='text-left'>ARPPU</th>
                <th class='text-left '>新用户付费金额</th>
                <th class='text-left '>新用户付费人数</th>
                <th class='text-left '>新用户付费次数</th>
                <th class='text-left '>新用户付费率</th>
                <th class='text-left '>新用户ARPU</th>
                <th class='text-left '>新用户ARPPU</th>
                <th class='text-left '>活跃用户日平均游戏时长(分钟)</th>
                <th class='text-left '>新增用户日平均游戏时长(分钟)</th>
                <th class='text-left nowrap'>次日留存</th>
                <th class='text-left nowrap'>三日留存</th>
                <th class='text-left nowrap'>七日留存</th>
                <th class='text-left nowrap'>十四日留存</th>
            </tr>
            </thead>
            {/notempty}
            <tbody>
            {foreach $list as $key=>$vo}
                <tr>
                    <td class='text-left nowrap'>{$vo.date}</td>
                    <td class='text-left nowrap'>
                        {eq name='$vo.channel_name' value='0' }
                            官方-0-渠道
                        {else}
                        {$vo.channel_name}
                        {/eq}
                    </td>
                    <td class='text-left nowrap'>{$vo.dru}</td>
                    <td class='text-left nowrap'>
                        {eq name='$vo.add_bankruptcy_rate' value='0' }
                              --
                            {else}
                           {$vo.add_bankruptcy_rate*100}%
                        {/eq}
                    </td>
                    <td class='text-left nowrap'>{$vo.dayactivity}</td>
                    <td class='text-left nowrap'>
                        {eq name='$vo.bankruptcy_rate' value='0' }
                             --
                        {else}
                            {$vo.bankruptcy_rate*100}%
                        {/eq}
                    </td>
                    <td class='text-left nowrap'>{$vo.allmoney}</td>
                    <td class='text-left nowrap'>{$vo.rechange_num}</td>
                    <td class='text-left nowrap'>{$vo.order_num}</td>
                    <td class='text-left nowrap'>{$vo.avg_pay_num}</td>
                    <td class='text-left nowrap'>
                        {eq name='$vo.pay_rate' value='0' }
                            --
                        {else}
                            {$vo.pay_rate*100}%
                        {/eq}
                    </td>
                    <td class='text-left nowrap'>{$vo.arpu}</td>
                    <td class='text-left nowrap'>{$vo.arppu}</td>
                    <td class='text-left nowrap'>{$vo.addrechrge_amount}</td>
                    <td class='text-left nowrap'>{$vo.addrechrge_number}</td>
                    <td class='text-left nowrap'>{$vo.add_order_num}</td>
                    <td class='text-left nowrap'>
                        {eq name='$vo.add_pay_rate' value='0' }
                            --
                        {else}
                            {$vo.add_pay_rate*100}%
                        {/eq}
                    </td>
                    <td class='text-left nowrap'>{$vo.addarpu}</td>
                    <td class='text-left nowrap'>{$vo.addarppu}</td>
                    <td class='text-left nowrap'>
                        {eq name='$vo.user_online_avg_time' value='0' }
                         --
                        {else}
                        <span class="color-red">{$vo.user_online_avg_time}分钟</span>
                        {/eq}
                    </td>
                    <td class='text-left nowrap'>
                        {eq name='$vo.add_user_online_avg_time' value='0' }
                          --
                        {else}
                         <span class="color-blue">{$vo.add_user_online_avg_time}分钟</span>
                        {/eq}
                    </td>
                    <td class='text-left nowrap'>
                        {eq name='$vo.second_day' value='0' }
                             --
                        {else}
                            {$vo.second_day*100}%
                        {/eq}
                    </td>
                    <td class='text-left nowrap'>
                        {eq name='$vo.third_day' value='0' }
                            --
                        {else}
                            {$vo.third_day*100}%
                        {/eq}
                    </td>
                    <td class='text-left nowrap'>
                        {eq name='$vo.seventh_day' value='0' }
                             --
                        {else}
                            {$vo.seventh_day*100}%
                        {/eq}
                    </td>
                    <td class='text-left nowrap'>
                        {eq name='$vo.fifth_day' value='0' }
                            --
                        {else}
                            {$vo.fifth_day*100}%
                        {/eq}
                    </td>
                </tr>
            {/foreach}
            </tbody>
        </table>
        <table class="layui-table margin-top-10" lay-skin="line" >
            <thead>
            <tr>
                <th class="text-left nowrap" style="padding-left: 155px;" >合计</th>
                <th class='text-left nowrap'> 新增人数:<?php echo array_sum(array_column($data_arr,'dru')); ?></th>
                <th class='text-left nowrap'>活跃人数:<?php echo array_sum(array_column($data_arr,'dayactivity')); ?></th>
                <th class='text-left nowrap'>付费金额:<?php echo array_sum(array_column($data_arr,'allmoney')); ?></th>
                <th class='text-left nowrap'>付费用户:<?php echo array_sum(array_column($data_arr,'rechange_num')); ?></th>
                <th class='text-left nowrap'>付费次数:<?php echo array_sum(array_column($data_arr,'order_num')); ?></th>
                <th class='text-left nowrap'>新用户付费金额:<?php echo array_sum(array_column($data_arr,'addrechrge_amount')); ?></th>
                <th class='text-left nowrap'>新用户付费人数:<?php echo array_sum(array_column($data_arr,'addrechrge_number')); ?></th>
                <th class='text-left nowrap'>新用户付费次数:<?php echo array_sum(array_column($data_arr,'add_order_num')); ?></th>
            </tr>
            <tr>
                <th class="text-left nowrap" style="padding-left: 155px;" >平台分成</th>
                <th class='text-center ' colspan="3" >
                    <span class="color-red">
                        平台总收入:{$platform_recharge_amout.platform_recharge_amout}
                    </span>
                </th>
                <th class='text-center ' colspan="3" >
                     <span class="color-blue">
                       分成金额:{$platform_recharge_amout.platform_recharge_amout_rate}
                    </span>
                </th>
                <th class='text-center ' colspan="3" >
                    <span class="color-green">
                       平台净收入:{$platform_recharge_amout.platform_recharge_amout_down}
                    </span>
                </th>
            </tr>
            </thead>
        </table>
    </div>
    {$pages | Raw}
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
<div class="think-box-shadow store-total-container notselect" >
    <div class="layui-row layui-col-space15" >
        <div class="margin-bottom-15">充值线图 <b style="font-size: 12px;color: #ccc;" >30天</b></div>
        <div id="games_user_recharge" style="height:350px;width:100%;" >
        </div>
    </div>
</div>
<div class="think-box-shadow store-total-container notselect" >
    <div class="layui-row layui-col-space15" >
        <div class="margin-bottom-15">新增用户线图 <b style="font-size: 12px;color: #ccc;" >30天</b></div>
        <div id="games_user_dru" style="height:350px;width:100%;" >
        </div>
    </div>
</div>
<div class="think-box-shadow store-total-container notselect" >
    <div class="layui-row layui-col-space15" >
        <div class="margin-bottom-15">活跃用户线图 <b style="font-size: 12px;color: #ccc;" >30天</b></div>
        <div id="games_user_dayactivity" style="height:350px;width:100%;" >
        </div>
    </div>
</div>
<div class="think-box-shadow store-total-container notselect" >
    <div class="layui-row layui-col-space15" >
        <div class="margin-bottom-15">留存线图 <b style="font-size: 12px;color: #ccc;" >30天</b></div>
        <div id="games_retain" style="height:350px;width:100%;" >
        </div>
    </div>
</div>
<script>
    require(['echarts'], function (echarts, chart) {
        chart = echarts.init(document.getElementById('games_user_recharge'));
        window.onresize = chart.resize;
        option = {
            tooltip : {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross',
                    label: {
                        backgroundColor: '#6a7985'
                    }
                }
            },
            legend: {
                data:['充值线图']
            },
            toolbox: {
                orient: 'vertical',
                x: 'right',
                y: 'center',
                show : true,
                feature : {
                    mark : {show: true},
                    dataView : {show: true, readOnly: false},
                    magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
                    restore : {show: true},
                    saveAsImage : {show: true}
                }
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis : [
                {
                    type : 'category',
                    boundaryGap : false,
                    data :eval('{:json_encode($user_recharge_remain.time)}')
                }
            ],
            yAxis : [
                {
                    type : 'value',
                    axisLabel: {
                        color: '#2f9de2',
                        formatter: "{value}元"
                    },
                    splitLine: {
                        lineStyle: {
                            type: 'dashed',
                            color: '#cccccc'
                        }
                    }
                }
            ],
            series : [
                {
                    name:'充值线图',
                    type:'line',
                    stack: '总量',
                    data: eval('{:json_encode($user_recharge_remain.allmoney)}'),
                    lineStyle: {
                        normal: {
                            color: '#e23845',
                            width: 1,
                            type: 'dashed'
                        }
                    },
                    itemStyle: {
                        normal: {
                            borderWidth: 2,
                            borderColor: '#55ffd1',
                        }
                    }
                },
            ]
        };
        chart.setOption(option);
    });
</script>
<script>
    require(['echarts'], function (echarts, chart) {
        chart = echarts.init(document.getElementById('games_user_dru'));
        window.onresize = chart.resize;
        option = {
            tooltip : {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross',
                    label: {
                        backgroundColor: '#6a7985'
                    }
                }
            },
            legend: {
                data:['新增用户线图']
            },
            toolbox: {
                orient: 'vertical',
                x: 'right',
                y: 'center',
                show : true,
                feature : {
                    mark : {show: true},
                    dataView : {show: true, readOnly: false},
                    magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
                    restore : {show: true},
                    saveAsImage : {show: true}
                }
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis : [
                {
                    type : 'category',
                    boundaryGap : false,
                    data :eval('{:json_encode($user_dru_remain.time)}')
                }
            ],
            yAxis : [
                {
                    type : 'value',
                    axisLabel: {
                        color: '#2f9de2',
                        formatter: "{value}人"
                    },
                    splitLine: {
                        lineStyle: {
                            type: 'dashed',
                            color: '#cccccc'
                        }
                    }
                }
            ],
            series : [
                {
                    name:'新增用户线图',
                    type:'line',
                    stack: '总量',
                    data: eval('{:json_encode($user_dru_remain.dru)}'),
                    lineStyle: {
                        normal: {
                            color: '#2f9de2',
                            width: 1,
                            type: 'dashed'
                        }
                    },
                    itemStyle: {
                        normal: {
                            borderWidth: 2,
                            borderColor: '#ff7d7d',
                        }
                    }
                },
            ]
        };
        chart.setOption(option);
    });
</script>
<script>
    require(['echarts'], function (echarts, chart) {
        chart = echarts.init(document.getElementById('games_user_dayactivity'));
        window.onresize = chart.resize;
        option = {
            tooltip : {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross',
                    label: {
                        backgroundColor: '#6a7985'
                    }
                }
            },
            legend: {
                data:['活跃用户线图']
            },
            toolbox: {
                orient: 'vertical',
                x: 'right',
                y: 'center',
                show : true,
                feature : {
                    mark : {show: true},
                    dataView : {show: true, readOnly: false},
                    magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
                    restore : {show: true},
                    saveAsImage : {show: true}
                }
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis : [
                {
                    type : 'category',
                    boundaryGap : false,
                    data :eval('{:json_encode($user_dayactivity_remain.time)}')
                }
            ],
            yAxis : [
                {
                    type : 'value',
                    axisLabel: {
                        color: '#2f9de2',
                        formatter: "{value}人"
                    },
                    splitLine: {
                        lineStyle: {
                            type: 'dashed',
                            color: '#cccccc'
                        }
                    }
                }
            ],
            series : [
                {
                    name:'活跃用户线图',
                    type:'line',
                    stack: '总量',
                    data: eval('{:json_encode($user_dayactivity_remain.dayactivity)}'),
                    lineStyle: {
                        normal: {
                            color: '#b938e2',
                            width: 1,
                            type: 'dashed'
                        }
                    },
                    itemStyle: {
                        normal: {
                            borderWidth: 2,
                            borderColor: '#ffa427',
                        }
                    }
                },
            ]
        };
        chart.setOption(option);
    });
</script>
<script>
    require(['echarts'], function (echarts, chart) {
        chart = echarts.init(document.getElementById('games_retain'));
        window.onresize = chart.resize;
        option = {
            tooltip : {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross',
                    label: {
                        backgroundColor: '#6a7985'
                    }
                }
            },
            legend: {
                data:['次日留存','3日留存','7日留存','15日留存']
            },
            toolbox: {
                orient: 'vertical',
                x: 'right',
                y: 'center',
                show : true,
                feature : {
                    mark : {show: true},
                    dataView : {show: true, readOnly: false},
                    magicType : {show: true, type: ['line', 'bar', 'stack']},
                    restore : {show: true},
                    saveAsImage : {show: true}
                }
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis : [
                {
                    type : 'category',
                    boundaryGap : false,
                    data :eval('{:json_encode($user_thirty_day_remain.time)}')
                }
            ],
            yAxis : [
                {
                    type : 'value',
                    axisLabel: {
                        color: '#2f9de2',
                        formatter: "{value}%"
                    },
                    splitLine: {
                        lineStyle: {
                            type: 'dashed',
                            color: '#cccccc'
                        }
                    }
                }
            ],
            series : [
                {
                    name:'次日留存',
                    type:'line',
                    tiled: '总量',
                    data: eval('{:json_encode($user_thirty_day_remain.second_day_count)}'),
                    lineStyle: {
                        normal: {
                            color: '#e2612f',
                            width: 1,
                        }
                    },
                    itemStyle: {
                        normal: {
                            borderWidth: 1,
                            borderColor: '#e2612f',
                            color: '#e2612f'
                        }
                    }
                },{
                    name:'3日留存',
                    type:'line',
                    tiled: '总量',
                    data: eval('{:json_encode($user_thirty_day_remain.third_day_count)}'),
                    lineStyle: {
                        normal: {
                            color: '#3b3f70',
                            width: 1,
                        }
                    },
                    itemStyle: {
                        normal: {
                            borderWidth: 1,
                            borderColor: '#3b3f70',
                            color: '#3b3f70'
                        }
                    }
                },
                {
                    name:'7日留存',
                    type:'line',
                    tiled: '总量',
                    data: eval('{:json_encode($user_thirty_day_remain.seventh_day_count)}'),
                    lineStyle: {
                        normal: {
                            color: '#2f9de2',
                            width: 1,
                        }
                    },
                    itemStyle: {
                        normal: {
                            borderWidth: 1,
                            borderColor: '#2f9de2',
                            color: '#2f9de2'
                        }
                    }
                },
                {
                    name:'15日留存',
                    type:'line',
                    tiled: '总量',
                    data: eval('{:json_encode($user_thirty_day_remain.fifth_day_count)}'),
                    lineStyle: {
                        normal: {
                            color: '#e2dc57',
                            width: 1,
                        }
                    },
                    itemStyle: {
                        normal: {
                            borderWidth: 1,
                            borderColor: '#e2dc57',
                            color: '#e2dc57'
                        }
                    }
                },
            ]
        };
        chart.setOption(option);
    });
</script>
{/block}
